#ifndef PROXYSERVER_SERVER_WS_MODULE_H
#define PROXYSERVER_SERVER_WS_MODULE_H

#include "Protocol/Protocol.h"
#include "PluginModule/IProxyServerNetWSModule.h"
#include "PluginModule/IProxyServerToWorldModule.h"
#include "PluginModule/ILogModule.h"
#include "PluginModule/IWSModule.h"
#include "PluginModule/IProxyServerToGameModule.h"
#include "PluginModule/INetClientModule.h"
#include "PluginModule/ISecurityModule.h"

namespace FragrantGrass
{
	class ProxyServerNetWSModule : public IProxyServerNetWSModule
	{
	public:
		ProxyServerNetWSModule(IPluginManager* p)
		{
			m_pPluginManager = p;
		}

		virtual bool Init();
		virtual bool Shut();
		virtual bool Execute();

		virtual bool AfterInit();

	protected:

		void OnSocketClientEvent(const SOCK nSockIndex, const FG_NET_EVENT eEvent, INet* pNet);

		void OnClientDisconnect(const SOCK nAddress);
		void OnClientConnected(const SOCK nAddress);

		void OnWebSocketTestProcess(const SOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen);

	protected:
		std::map<GUID, SOCK> mxClientIdent;

	protected:
		INetClientModule* m_pNetClientModule;
		ILogModule* m_pLogModule;
		//IWSModule* m_pWSModule;
		ISecurityModule* m_pSecurityModule;
		IProxyServerToWorldModule* m_pProxyToWorldModule;

	};
}

#endif//PROXYSERVER_SERVER_WS_MODULE_H